#include <bits/stdc++.h>
#include <string>

using namespace std;

vector<pair<int, int>> v;

vector<int> c(int n, int d, int a, int b)
{
    int x, y;
    for (int i = 0; i < n; i++) {
        cin >> x >> y;
        v.push_back({a * x + b * y, i + 1});
    }

    sort(v.begin(), v.end());

    vector<int> ans;

    for (int i = 0; i < n; i++) {
        if (v[i].first <= d) {
            ans.push_back(v[i].second);
            d -= v[i].first;
        }
    }

    return ans;
}

int main()
{
    int n, d, a, b;
    cin >> n >> d >> a >> b;
    auto ans = c(n, d, a, b);
    string an;
    for(int i : ans)
        an += (to_string(i) + " ");
    cout << ans.size() << endl << an << endl;
    return 0;
}
